$(document).ready(function () {
    let rows = 30
    let cell = 50
    for (let rowIndex = 0; rowIndex < rows; rowIndex++) {
        let rowDiv = $("<div>").addClass('rowDiv')
        for (let cellIndex = 0; cellIndex < cell; cellIndex++) {
            let cellDiv = $("<div>")
            cellDiv.css({
                "height": "20px",
                "width": "20px",
                "border": "1px #ffffff solid",
                "background-color": "#7fffd4"
            })
            cellDiv.addClass("row_"+rowIndex)
            cellDiv.addClass("cell_"+cellIndex)

            rowDiv.append(cellDiv)
        }
        $("#plate").append(rowDiv)
    }
    let player={
        nikeName:"吞天巨蟒",
        position:[
            {
                x:0,
                y:0,
            },{
                x:0,
                y:1,
            },
            {
                x:0,
                y:2,
            }
        ],
        color:"000000"
    }
    player.position.forEach(value=>{
        console.log(value);
        let cell=$(".row_"+value.x+".cell_"+value.y)
        console.log(cell);
        cell.css({
            "background-color":"#"+player.color
        })
    })
});